package main.od;

import java.util.*;

public class ArrayDeduplicateSort {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = Arrays.stream(sc.nextLine().split(","))
                .mapToInt(Integer::parseInt).toArray();
        Map<Integer, Integer> map = new HashMap<>();
        for (int temp : arr){
            map.put(temp,map.getOrDefault(temp,0) + 1);
        }
        List<Map.Entry<Integer,Integer>> list = new ArrayList<>(map.entrySet());
        list.sort((o1, o2) -> o2.getValue() - o1.getValue());
        Map<Integer,Integer> sortMap = new LinkedHashMap<>();
        for (Map.Entry<Integer,Integer> entry : list){
            sortMap.put(entry.getKey(),entry.getValue());
        }
        for (Map.Entry<Integer,Integer> temp : sortMap.entrySet()){
            System.out.print(temp.getKey() + ",");
        }
    }
}
